import React, { Component } from 'react'
import eventBus from './utils/event-bus'

export class Banner extends Component {
  handleClick(type) {
    switch (type) {
      case 'prev':
        eventBus.emit('banner-change', 'prev', '张三', 13)
        break
      case 'next':
        eventBus.emit('banner-change', 'next', '李四', 22)
        break
      default:
        break
    }
  }
  render() {
    return (
      <div>
        <h3>Banner</h3>
        <button onClick={() => this.handleClick('prev')}>上一步</button>
        <button onClick={() => this.handleClick('next')}>下一步</button>
      </div>
    )
  }
}

export default Banner